package com.example.barcodeapp.ui.wode.fragment;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.example.barcodeapp.R;
import com.example.barcodeapp.base.BaseFragment;
import com.example.barcodeapp.interfaces.IBasePersenter;
import com.example.barcodeapp.interfaces.own.IOwn;
import com.example.barcodeapp.persenter.OnePresenterYouHuiJuan;
import com.example.barcodeapp.ui.own.bean.YouHuiJuanBean;
import com.example.barcodeapp.ui.wode.adapter.YouHuiJuanQuanBuAdapter;

import butterknife.BindView;

public class QuanBuFragment extends BaseFragment<IOwn.Persenteryouhuijuan> implements IOwn.Viewyouhuijuani {
    @BindView(R.id.youhuijuanquanbu)
    RecyclerView youhuijuanquanbu;

    @Override
    protected int getLayout() {
        return R.layout.quanbu_fragment;
    }

    @Override
    protected void initView() {

    }

    @Override
    protected OnePresenterYouHuiJuan initPersenter() {
        return new OnePresenterYouHuiJuan();
    }

    @Override
    protected void initData() {
persenter.getyouhuijuan(1,0);
    }

    @Override
    public void getyouhuijuan(YouHuiJuanBean xiLieKeBean) {

        YouHuiJuanQuanBuAdapter youHuiJuanQuanBuAdapter = new YouHuiJuanQuanBuAdapter(context,xiLieKeBean.getData());
        youhuijuanquanbu.setLayoutManager(new LinearLayoutManager(getActivity()));
        youhuijuanquanbu.setAdapter(youHuiJuanQuanBuAdapter);
        youHuiJuanQuanBuAdapter.notifyDataSetChanged();

    }
}
